package com.joshua.hello.controller;

import com.joshua.hello.entity.UserEntity;
import com.joshua.hello.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("user")
@RestController
@Slf4j
public class UserController {

    @Resource
   private UserService userService;

    @GetMapping("/findUserById/{id}")
    public UserEntity hello(@PathVariable Long id){
        return userService.getUserById(id);
    }

    @GetMapping("/printErrorContent")
    public void printErrorContent(){
        log.error("测试错误日志。。。。。。");
    }
}
